/**
 * problem_006.c
 * Copyright (C) 2011-03-18 - xrose
 * Find the difference between the sum of the squares of the first one hundred
 * natural numbers and the square of the sum.
 */

#include <stdio.h>
#define square(x) x*x

int main (int argc, char *argv[])
{
    int result;
    int x = 100;

    result = - _sum_of_square(x) + square(x*(x+1))/4;
    printf("The Answer is: %d\n", result);
    return 0;
}
int _sum_of_square(int n)
{
    register int soq = 0;
    register int i;
    for(i = 0; i<=n; i++)
    {
        soq+=square(i);
    }
    return soq;
}
